-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS -- Add 'util' object #12530
JS -- Add 'util' object #12530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed everything from the top of the file until _getTZ
so far, so this is the first set of comments. It's quite a lot of code and requires careful matching with the spec, so I'll do it in chunks. Nice work so far!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now reviewed everything up until scand
.
src/scripting_api/util.js
Outdated
K: data => { | ||
return (1 + ((data.hours + 23) % 24)).toString(); | ||
}, | ||
mm: data => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's conflicting with he MM
for month... I don't really know how to handle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to check how acrobat (last version) is dealing with that stuff and astonishingly it doesn't handle the 3rd argument (i.e. bXFAPicture), so it's quite confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Acrobat isn't handling it at all and there is confusion in the specification, I'd really like to remove it completely from this patch (i.e, remove _printdXFAPicture
and its call, but keep the bXFAPicture
in printd
for API consistency, just don't do anything with it and add a comment why we ignore it). It will be more consistent with Acrobat (our reference implementation) and that avoids us from filling in any blanks we can't verify. Moreover, I don't think this functionality is actually used often, and it would make the overall patch considerable smaller. It can always be added again in a follow-up PR.
6ee443a
to
5513a4e
Compare
Do you know why CI is broken ? |
Because the new files aren't included in the diff --git a/gulpfile.js b/gulpfile.js
index a8344793c..71446553a 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1273,9 +1273,9 @@ function buildLib(defines, dir) {
return merge([
gulp.src(
[
- "src/{core,display,shared}/*.js",
+ "src/{core,display,scripting_api,shared}/*.js",
"!src/shared/{cffStandardStrings,fonts_utils}.js",
- "src/{pdf,pdf.worker}.js",
+ "src/{pdf,pdf.scripting,pdf.worker}.js",
],
{ base: "src/" }
), |
/botio-linux unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/754d1514ec9104a/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/754d1514ec9104a/output.txt Total script time: 3.50 mins
|
This patch provides an implementation of the util object as described: * https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_api_reference.pdf#page=716
/botio-linux unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @brendandahl received. Current queue size: 0 Live output at: http://54.67.70.0:8877/08682f62953f841/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/08682f62953f841/output.txt Total script time: 3.53 mins
|
Looks good to me too. Thanks! |
This patch provides an implementation of the util object as described: